package com.wiscamp.ninechapters.problems.application.assemblers;

import com.wiscamp.ninechapters.problems.application.dto.commands.exams.CreatePaperPartCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.exams.CreatePaperSectionCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.exams.UpdatePaperPartCommand;
import com.wiscamp.ninechapters.problems.application.dto.commands.exams.UpdatePaperSectionCommand;
import com.wiscamp.ninechapters.problems.application.dto.vo.exams.PaperPartVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.exams.PaperSectionVO;
import com.wiscamp.ninechapters.problems.domain.models.exams.PaperPart;
import com.wiscamp.ninechapters.problems.domain.models.exams.PaperSection;
import org.mapstruct.Mapper;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface PaperPartAssembler {

    PaperPartAssembler Instance = Mappers.getMapper(PaperPartAssembler.class);

    // region part
    PaperPartVO toPaperPartVO(PaperPart entity);

    PaperPart fromCreateCommand(CreatePaperPartCommand command);

    PaperPart fromUpdateCommand(UpdatePaperPartCommand command);
    // endregion

    // region section
    PaperSectionVO toPaperSectionVO(PaperSection entity);

    PaperSection fromCreateCommand(CreatePaperSectionCommand command);

    PaperSection fromUpdateCommand(UpdatePaperSectionCommand command);
    // endregion
}
